<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

    <title>会员列表</title>

    <link href="../../css/mine.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="/js/jquery.js"></script>
</head>
<body>
<style>
    .tr_color {
        background-color: #9F88FF
    }
</style>
<div class="div_head">
            <span>
                <span style="float: left;">当前位置是：招聘管理-》职位发布管理</span>
                 <span style="float: right; margin-right: 8px; font-weight: bold;">
                    <a style="text-decoration: none;" href="/zhaopin/demo1/checkDept">【添加】</a>
                </span>
            </span>
</div>
<div></div>
<div class="div_search">
            <span>
                <form action="/zhaopin/demo1/jobPublish" method="post">
				    职位名称:
					<input type="text" name="recruitName" value="${recruitName}"/>
                    职位分类: 
					<select name="jobType" style="width: 100px;">
                        <option value="">--请选择--</option>
						<option value="管理">管理</option>
                        <option value="技术">技术</option>
						<option value="实施">实施</option>
                    </select>
					 登记日期: 
					<input type="text" name="registrationTime" value="${registrationTime}"/>
                    截止日期:<input type="text" name="deadline" value="${deadline}"/>
					
					<input value="查询" type="submit"/>
					
                </form>
            </span>

</div>
<!--  <div style="font-size: 13px; margin: 10px 5px;">
 <p><a href="add.jsp"><button style="background-color:#E8F2FC">职位发布登记 </button></a></p>
 </div> -->
<div style="font-size: 13px; margin: 10px 5px;">
    <table class="table_a" border="1" width="100%">

        <tbody>
        <tr style="font-weight: bold;">
            <td width="40px;">职位编码</td>
            <td width="40px;">职位名称</td>
            <td width="40px;">职位分类</td>
            <td width="40px;">所属部门</td>
            <td width="40px;">招聘人数</td>
            <td width="40px;">登记日期</td>
            <td width="40px;">截止日期</td>
            <td align="center" width="70px;">操作</td>
        </tr>
        <c:forEach items="${pageInfo.list}" var="job">
            <tr id="product1">
                <td>${job.jobCoding}</td>
                <td><a href="view.jsp">${job.recruitName}</a></td>
                <td>${job.jobType}</td>
                <td>${job.dept.deptname}</td>
                <td>${job.recruitCount}</td>
                <td>${job.registrationTime}</td>
                <td>${job.deadline}</td>
                <td><a href="/zhaopin/demo1/checkOneJob?id=${job.id}">变更</a> &nbsp;&nbsp;<a href="javascript:void(0)" onclick="deleteJob(${job.id},this)">删除</a></td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="20" style="text-align: center;">
                <a style="text-decoration: none;"
                   href="/zhaopin/demo1/jobPublish?jobType=${jobType}&recruitName=${recruitName}&registrationTime=${registrationTime}&deadline=${deadline}">
                    首页
                </a>
                <a style="text-decoration: none;"
                   href="/zhaopin/demo1/jobPublish?page=${pageInfo.prePage==0?1:pageInfo.prePage}&jobType=${jobType}&recruitName=${recruitName}&registrationTime=${registrationTime}&deadline=${deadline}">
                    上一页
                </a>
                <c:forEach var="s" begin="1" end="${pageInfo.pages}">
                    <a style="text-decoration: none;"
                       href="/zhaopin/demo1/jobPublish?page=${s}&jobType=${jobType}&recruitName=${recruitName}&registrationTime=${registrationTime}&deadline=${deadline}">
                            ${s}
                    </a>
                </c:forEach>
                <a style="text-decoration: none;"
                   href="/zhaopin/demo1/jobPublish?page=${pageInfo.nextPage==0?pageInfo.pages:pageInfo.nextPage}&jobType=${jobType}&recruitName=${recruitName}&registrationTime=${registrationTime}&deadline=${deadline}">
                    下一页
                </a>
                <a style="text-decoration: none;"
                   href="/zhaopin/demo1/jobPublish?page=${pageInfo.pages}&jobType=${jobType}&recruitName=${recruitName}&registrationTime=${registrationTime}&deadline=${deadline}">
                    尾页
                </a>
                共${pageInfo.total}条 第${pageInfo.pageNum}页/共${pageInfo.pages}页
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
<script type="text/javascript">
    function deleteJob(id, obj) {
        if(confirm("确定删除吗？")){
            $.getJSON(
                "/zhaopin/demo1/deleteJob",
                {id:id},
                function (result) {
                    if(result.code==0){
                        alert("删除成功！")
                        $(obj).parent().parent().remove()
                    }else{
                        alert(result.msg)
                    }
                }
            )
        }
    }
</script>
</html>
